# encoding=utf-8
from __future__ import print_function

import pandas as pd
import numpy as np

datafile = '../dataSets/chapter4/data/principal_component.xls'
outfile = '../tmp/dimention_reducted.xls'

data = pd.read_excel(datafile, header=None)

from sklearn.decomposition import PCA

pca = PCA()
pca.fit(data)
print(pca.components_)
print(pca.explained_variance_ratio_)
